package com.soil.code.generation.domain.persistencetier.service;

import com.soil.code.generation.domain.persistencetier.entity.PersistenceObject;
import com.soil.code.generation.domain.persistencetier.entity.PersistenceObjectCodeGeneration;
import com.soil.code.generation.infrastructure.AbstractFreeMakerCodeGenerator;
import freemarker.template.Template;
import freemarker.template.TemplateException;

import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.Writer;

/**
 * 持久层模板
 * @auth zeno
 * @date 2022/8/6 22:21
 */
public class PersistenceObjectFreeMakerCodeGenerator extends AbstractFreeMakerCodeGenerator{

	public PersistenceObjectFreeMakerCodeGenerator() throws IOException{
		super("");
	}

	public void generate(PersistenceObjectCodeGeneration codeGeneration ) throws IOException, TemplateException {


	}

	private void generatePOClass(PersistenceObjectCodeGeneration codeGeneration) throws IOException,
	                                                                                    TemplateException{
		Template template = templateConfig.getTemplate("PersistenceObject.java.ftl");
		Writer out = new OutputStreamWriter(System.out);

		template.process(codeGeneration, out);
	}
}
